package com.rybbaby.tss.tests;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.io.IOUtils;

/**
 * @description
 * 
 * @author 谢进伟
 * 
 * @createDate 2016年11月15日 下午11:22:18
 */
public class Demo06 {
	
	public static void main(String [] args) {
		try {
			String file = "C:/Users/xiejinwei/AppData/Local/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets";
			File f = new File(file);
			File [] listFiles = f.listFiles();
			for(File file2 : listFiles) {
				InputStream input = new FileInputStream(file2);
				File file3 = new File("e:/aa/" + System.nanoTime() + ".jpg");
				OutputStream output = new FileOutputStream(file3);
				IOUtils.copy(input , output);
				org.apache.commons.io.IOUtils.closeQuietly(input);
				org.apache.commons.io.IOUtils.closeQuietly(output);
			}
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
